<?php namespace Phpcmf\Controllers;

/**
 * 二次开发时可以修改本文件，不影响升级覆盖
 */

class Guanzhu extends \Phpcmf\Home\Module
{

	public function index() {
		$uid = \Phpcmf\Service::L('input')->get('uid');
		if($this->uid) {
			$this->_json('0', '不能关注自己');
		}
		if(!$uid) {
			$zhi = 0;
		}
		$zhi = \Phpcmf\Service::M()->db->table('member_guanzhu')->where('uid', $this->uid)->where('touid', $uid)->countAllResults();
		if($zhi) {
			$zhi = 1;
		} else {
			$zhi = 0;
		}
		$guanzhu = [
			'data' => $zhi,
			'uid' => $this->uid,
			'touid' => $uid,
		];

		$this->_json('1', '读取成功', $guanzhu);
	}

}
